<html>

<head>
<title>SQL Relay - Getting Started With Sybase - Initializing an 12.5 Server</title>
<link rel="stylesheet" href="../../css/styles.css">
</head>

<body>

<span class="heading1">Note...</span><br>

<p>I've never been able to get these instructions to work 100%.  On Redhat 9,
there appears to be a glibc incompatibility and asecfg won't finish
successfully.  On Redhat 7.3, asecfg alledgedly finishes successfully but 
doesn't appear to create the database storage files and I get license-related
failures trying to run the server.  Hopefully I'm making some obvious mistake
that you'll be able to avoid.  If you figure out what the problem is, let me
know at <a href="mailto:david.muse@firstworks.com">david.muse@firstworks.com</a>.</p>

<span class="heading1">Installing a license for 12.5</span><br>

<p>Unlike previous versions of Sybase ASE, version 12.5 needs to be licensed
before it can be installed.  If you downloaded Sybase ASE, you should have
received an email from sybase with a license code in it.  If the email contains
the following pieces of information, then you have a "real" license:</p>

<ul>
<li>Order Number</li>
<li>Feature Name</li>
<li>Feature Count</li>
<li>Software Version</li>
<li>Authorization Code</li>
</ul>

<p>Otherwise, you have a "demo" license.  A demo license will have an
expiration date.</p>

<p>Follow these instructions to license Sybase ASE.</p>

<blockquote>
<p>Log in as root and run /opt/sybase-12.5/install/sybinstall.sh</p>
<blockquote>
<b>Note:</b> If you moved /opt/sybase-12.5 to some other directory to save
space on the /opt partition and then symlinked it back to /opt/sybase-12.5,
the sybinstall.sh script will fail and report errors.  To solve the problem,
modify it as follows and re-run it.  Change:
<blockquote><b>chmod ug+w `find ${SYBASE} -type d -print`</b></blockquote>
to
<blockquote><b>chmod ug+w `find ${SYBASE}/ -type d -print`</b></blockquote>
</blockquote>
<p>Log in as the sybase user.</p>
<p>You're supposed to start the license manager daemon here, but it always
fails, so skip this step and run the license manager client.</p>
<p>The license manager client is a Java program.  If you are using a kernel
that supports the Native Posix Thread Library (such as the one that ships with
Redhat 9), you'll need to run the following command:</p>
<blockquote><i>export LD_ASSUME_KERNEL=2.4.1</i></blockquote>
<p>Run <i>lmgr</i>.  A graphical license manager application should pop up.</p>
<p><b>If you have a "real" license:</b> Leave the radio button for Ase checked
and click Next.  When the "Do you have a Sybase Software Asset Management
Certificate to register?" dialog pops up, click Yes.</p>
<p><b>If you have a "demo" license:</b> Check AseDemo and click Next.  A dialog
will pop up asking if you have upgraded to a real license.  Click No.</p>
<p>On the screen titled "Enter the information provided on your Sybase License
Certificate"</b>, enter the information from the email you received from Sybase
when you downloaded the software.  Click Done.</p>
<p>The program will bomb out, complaining that it tried to restart the license
manager, but couldn't.</p>
<p>Start the license server by running
<i>startd.sh $SYBASE/$SYBASE_SYSAM</i> manually.</p>
</blockquote>

<p>Now that the software has been licensed, it can be initialized.</p>

<span class="heading1">Initializing an 12.5 Server</span><br>


<p>After installing Sybase Adaptive Server Enterprise, you can initialize the 
server by following these steps.</p>

<p>Run <i>asecfg</i>.  A dialog will appear.
Click <b>Configure a new server</b>.</p>

<p>Another dialog will appear, prompting you to
<b>Click the check boxes for the types of servers to create and provide names
for these servers.</b></p>

<blockquote>
select <b>Adaptive Server</b><br>
enter a server name, I usually use localhost but any name will do<br>
select <b>OK</b><br>
</blockquote>

<p>A new dialog will appear, prompting you to enter filenames for <b>Master</b>
and <b>Sybsystemprocs</b> device files, and device and database sizes for each.

<blockquote>
enter <i>/opt/sybase-12.5/ASE/master.dat</i> for the <b>Master</b> device file<br>
enter <i>/opt/sybase-12.5/ASE/sybsystemprocs.dat</i> for the <b>Sybsystemprocs</b>
device file<br>
Select <b>Edit Advanced Adaptive Server Attributes</b><br>
</blockquote>

<p>A new dialog will appear, prompting you to enter filenames for the
<b>Sybsystemdb</b> device file, size and database sizes.</p>

<blockquote>
enter <i>/opt/sybase-12.5/ASE/sybsystemdb.dat</i> for the <b>Sybsystemdb</b> 
device file<br>
Select <b>Go Back</b><br>
</blockquote>

<p>This should return you to the previous dialog.</p>

<blockquote>
Select <b>Build Server!</b><br>
</blockquote>

<p>A warning dialog may appear indicating that the files are not raw device
files.  Ignore this warning and select <b>Yes</b> to proceed.</p>

<p>A Status Output dialog will appear.  As the database is built, the dialog 
provides feedback about the process.  When it's done, select <b>OK</b>.</p>

<b>For me, this step always fails on Redhat 9.  I've tried lots of different
things to try to make it work, but it never does.  Hopefully it will work for
you.  It succeeds on Redhat 7.3 but doesn't appear to actually cratate
master.dat, sybsystemprocs.dat or sybsystemdb.dat.</b>

<p>You should now be returned to the original dialog.  Click <b>Exit</b>.</p>

<span class="heading2">Starting the Database at Boot Time</span><br>

<p>The RPM distribution of Sybase ASE installs a script in /etc/rc.d/init.d 
which starts the database at boot time.  For non-RPM distributions, you may 
need to install a script like the following.  Replace <i>/opt/sybase-12.5</i> 
with whatever directory Sybase ASE is installed in.</p>

<blockquote>
<PRE>
<FONT color=#0000ff>#!/bin/sh</FONT>

<B><FONT color=#a62828>export </FONT></B><FONT color=#008a8e>SYBASE</FONT><B><FONT color=#a62828>=</FONT></B>/opt/sybase-12.5</FONT>

<B><FONT color=#a62828>export </FONT></B><FONT color=#008a8e>PATH</FONT><B><FONT color=#a62828>=</FONT></B><FONT color=#a620f7>$PATH</FONT>:<FONT color=#a620f7>$SYBASE</FONT>/ASE-12.5/bin:<FONT color=#a620f7>$SYBASE</FONT>/ASE-12.5/install

<B><FONT color=#a62828>export </FONT></B><FONT color=#008a8e>LANG</FONT><B><FONT color=#a62828>=</FONT></B>en_US</FONT>

<B><FONT color=#a62828>case</FONT></B> &quot;$1&quot; <B><FONT color=#a62828>in</FONT></B>
        start<B><FONT color=#a62828>)</FONT></B>
                <B><FONT color=#a62828>for</FONT></B> i <B><FONT color=#a62828>in</FONT></B> <FONT color=#6959cf>`ls </FONT><FONT color=#a620f7>$SYBASE</FONT><FONT color=#6959cf>/ASE-12.5/install/RUN_*`</FONT>
                <B><FONT color=#a62828>do</FONT></B>
                        su <B><FONT color=#a62828>-c</FONT></B> <B><FONT color=#a62828>&quot;</FONT></B><FONT color=#ff00ff>startserver -f </FONT><FONT color=#a620f7>$i</FONT><B><FONT color=#a62828>&quot;</FONT></B> sybase <B><FONT color=#a62828>&gt;</FONT></B> /dev/null <B><FONT color=#a62828>2&gt;&amp;1</FONT></B><B><FONT color=#a62828>;</FONT></B>
                <B><FONT color=#a62828>done</FONT></B>
                <B><FONT color=#a62828>;;</FONT></B>
        stop<B><FONT color=#a62828>)</FONT></B>
                <B><FONT color=#a62828>kill</FONT></B> <FONT color=#6959cf>`ps </FONT><FONT color=#6959cf>-efa</FONT><FONT color=#6959cf> </FONT><B><FONT color=#a62828>|</FONT></B><FONT color=#6959cf> grep sybase </FONT><B><FONT color=#a62828>|</FONT></B><FONT color=#6959cf> grep </FONT><FONT color=#6959cf>-v</FONT><FONT color=#6959cf> grep </FONT><B><FONT color=#a62828>|</FONT></B><FONT color=#6959cf> awk </FONT><B><FONT color=#a62828>'</FONT></B><FONT color=#ff00ff>{print $2}</FONT><B><FONT color=#a62828>'</FONT></B><FONT color=#6959cf>`</FONT>
                <B><FONT color=#a62828>;;</FONT></B>
        *<B><FONT color=#a62828>)</FONT></B>
                <B><FONT color=#a62828>echo</FONT></B><FONT color=#ff00ff> $</FONT><B><FONT color=#a62828>&quot;</FONT></B><FONT color=#ff00ff>Usage: </FONT><FONT color=#a620f7>$0</FONT><FONT color=#ff00ff> {start|stop}</FONT><B><FONT color=#a62828>&quot;</FONT></B>
                <B><FONT color=#a62828>exit</FONT></B> <FONT color=#ff00ff>1</FONT>
<B><FONT color=#a62828>esac</FONT></B>

<B><FONT color=#a62828>exit</FONT></B> <FONT color=#ff00ff>0</FONT>
</PRE>
</blockquote>

<p>Install this script and run it with the "start" option to start up the
database.  Running it with the "stop" option shuts the database down.  To
access a database, it must be running.</p>

</body>

</html>
